package com.doophan.duuchin.controller;

import com.doophan.duuchin.dto.QueryDTO;
import com.doophan.duuchin.service.VideoService;
import com.doophan.duuchin.util.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/video")
public class VideoController {
    @Resource
    private VideoService videoService;

    @PostMapping("/list")
    public R getList(@RequestBody QueryDTO queryDTO) {
        return R.successPage(videoService.getList(queryDTO));
    }

    @GetMapping("/info/{id}")
    public R getInfo(@PathVariable Integer id) {
        return R.successInfo(videoService.getInfo(id));
    }
}
